/**
 * 相关案例详情的Service
 * Created by Administrator on 2016/12/29.
 */
module.exports = function ($http,httpservice,$q) {
    var caseBarDetailAnLiDetailService = {};

  /*  *相关案例详情
    caseBarDetailAnLiDetailService.relevanceparticulars = function (index,pagesize,conditions) {
        var  params ={"index":index,"pagesize":pagesize,"conditions":conditions};
        var deferred = $q.defer();
        $http({
            method: 'GET',
            //  url: httpservice.CorrelationCaseUrl,
            url:"http://59.110.64.34:8088/solr/getDocById?index=1&pagesize=1&conditions=searchWord:%E7%BA%A0%E7%BA%B7&conditions=searchWord:%E6%A1%88",
            // data:params,
            headers : {'Content-Type':'application/json'}
        }).then(function successCallback(response) {
            deferred.resolve(response.data);
        }, function errorCallback(response) {
            deferred.reject(response);
        });
        return deferred.promise;
    };*/
    /**相关案例详情*/
    caseBarDetailAnLiDetailService.relevanceparticulars= function (index,pagesize,conditions) {
        var  params ={"index":index,"pagesize":pagesize,"conditions":conditions};
       // var  params ={"index":1,"pagesize":1,"conditions":"中国人民财产保险股份有限公司元氏支公司保险纠纷"};
        var deferred = $q.defer();
        $http({
            method: 'POST',
            url: httpservice.CorredetailCaseUrl,
           // url:"http://59.110.64.34:8088/solr/getDocById?index=1&pagesize=1&conditions=searchWord:%E7%BA%A0%E7%BA%B7&conditions=searchWord:%E6%A1%88",
            data:params,
            headers : {'Content-Type':'application/json'}
        }).then(function successCallback(response) {
            deferred.resolve(response.data);
        }, function errorCallback(response) {
            deferred.reject(response);
        });
        return deferred.promise;
    };

    /**相关案例ID查询详情*/
    caseBarDetailAnLiDetailService.demandID= function (id) {
        var  params ={"rId":id};
        var deferred = $q.defer();
        $http({
            method: 'POST',
           //url: "http://59.110.64.34:8088/solr/getDocById?id=18703",
            url: httpservice.UrlcasedetailById,
            params:params,
            headers : {'Content-Type':'application/json'}
        }).then(function successCallback(response) {
            deferred.resolve(response.data);
        }, function errorCallback(response) {
            deferred.reject(response);
        });
        return deferred.promise;
    };


    return caseBarDetailAnLiDetailService;
}